import {v4 as uuidv4} from 'uuid'
// 要生成一个随机字符串，且每次执行不能发生变化
export const getUUID = ()=>{
    // 先从本地存储获取UUID
    let uuid_token = localStorage.getItem('UUIDTOKEN')
    // 如果没有
    if(!uuid_token){
        uuid_token = uuidv4()
        //  生成的uuid存储到本地存贮中
        localStorage.setItem('UUIDTOKEN',uuid_token)
    }
    return uuid_token
}